{extend name="layout/base" /}
{block name="main"}
<article class="main__content content">
    <h4>评论列表</h4>
    <table class="table">
        <thead class="table__head">
        <tr>
            <th>ID</th>
            <th>用户名</th>
            <th>客房名称</th>
            <th>分数</th>
            <th>内容</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody class="table__body">
        {foreach $commentList as $comment}
        <tr>
            <td>{$comment.id}</td>
            <td>{$comment.username}</td>
            <td>{$comment.room_name}</td>
            <td>{$comment.score}</td>
            <td>{$comment.content}</td>
            <td>{$comment.create_time ?? ''}</td>
            <td>
                <div class="tpl-table-black-operation">
                    <a href="{:url('edit')}?id={$comment.id}">
                        <i class="am-icon-pencil"></i> 编辑
                    </a>
                    <a href="{:url('delete')}?id={$comment.id}"
                       class="tpl-table-black-operation-del">
                        <i class="am-icon-trash"></i> 删除
                    </a>
                </div>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
</article>
{/block}
